package com.ruoyi.info.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.ruoyi.info.mapper.InfoMajorMapper;
import com.ruoyi.info.domain.InfoMajor;
import com.ruoyi.info.service.IInfoMajorService;

import java.util.List;

/**
 * 专业Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-27
 */
@Service
public class InfoMajorServiceImpl extends ServiceImpl<InfoMajorMapper, InfoMajor> implements IInfoMajorService {

    @Override
    public List<InfoMajor> queryList(InfoMajor infoMajor) {
        LambdaQueryWrapper<InfoMajor> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(infoMajor.getMajorName())){
            lqw.like(InfoMajor::getMajorName ,infoMajor.getMajorName());
        }
        if (StringUtils.isNotBlank(infoMajor.getMajorCode())){
            lqw.eq(InfoMajor::getMajorCode ,infoMajor.getMajorCode());
        }
        return this.list(lqw);
    }

}